function initSpeciesTable() {
    const RNASeqHead = {
        "srrId": {"title": "SRR ID", "searchType": "text","formatter":"GetSrrId"},
        "sampleId": {"title": "Sample ID", "searchType": "text","formatter":""},
        "species": {"title": "Species", "searchType": "text","formatter":""},
        "project": {"title": "Project", "searchType": "text","formatter":""},
        "source": {"title": "Source", "searchType": "text","formatter":""},
        "developmentalStage": {"title": "Developmental Stage", "searchType": "text","formatter":""},
        "breed": {"title": "Breed", "searchType": "text","formatter":""},
        "tissue": {"title": "Tissue", "searchType": "text","formatter":""},
        "readLength": {"title": "Read length", "searchType": "text","formatter":""},
        "readType": {"title": "Read type", "searchType": "text","formatter":""},
        "readNumber": {"title": "Read number", "searchType": "text","formatter":""},
        "bases": {"title": "Bases(Gb)", "searchType": "text","formatter":""},
        "mappingRate": {"title": "Mapping rate(%)", "searchType": "text","formatter":""},
        "platform": {"title": "Platform", "searchType": "text","formatter":""},
        "references": {"title": "References", "searchType": "text","formatter":""},
        "pubmedId": {"title": "PubMed ID", "searchType": "text","formatter":""}
    };

    let RNASeqColumns = getTableColumns(RNASeqHead, "rnaSeqTable");

    $("#rnaSeqTable").bootstrapTable({
        columns: RNASeqColumns
    })

    const headMiRNA = {
        "srrId": {"title": "SRR ID", "searchType": "text","formatter":"GetSrrId"},
        "sampleId": {"title": "Sample ID", "searchType": "text","formatter":""},
        "species": {"title": "Species", "searchType": "text","formatter":""},
        "project": {"title": "Project", "searchType": "text","formatter":""},
        "source": {"title": "Source", "searchType": "text","formatter":""},
        "developmentalStage": {"title": "Developmental Stage", "searchType": "text","formatter":""},
        "breed": {"title": "Breed", "searchType": "text","formatter":""},
        "tissue": {"title": "Tissue", "searchType": "text","formatter":""},
        "readLength": {"title": "Read length", "searchType": "text","formatter":""},
        "readType": {"title": "Read type", "searchType": "text","formatter":""},
        "readNumber": {"title": "Read number", "searchType": "text","formatter":""},
        "bases": {"title": "Bases (Mb)", "searchType": "text","formatter":""},
        "mappingRate": {"title": "Mapping rate(%)", "searchType": "text","formatter":""},
        "platform": {"title": "Platform", "searchType": "text","formatter":""},
        "references": {"title": "References", "searchType": "text","formatter":""},
        "pubmedId": {"title": "PubMed ID", "searchType": "text","formatter":""}
    };

    let miRNAColumns = getTableColumns(headMiRNA, "miRnaTable");

    $("#miRnaTable").bootstrapTable({
        columns: miRNAColumns
    })

}

function initGeneTable() {
    const mRNAHead = {
        "geneid": {"title": "Gene ID", "searchType": "text","formatter":"GetGeneId"},
        "symbol": {"title": "Symbol", "searchType": "text","formatter":""},
        "type": {"title": "Type", "searchType": "text","formatter":""},
        "tf": {"title": "TF", "searchType": "text","formatter":""}
    };

    let mRNAColumns = getTableColumns(mRNAHead, "mRnaTable2");

    $("#mRnaTable2").bootstrapTable({
        columns:mRNAColumns
    })

    const miRNAHead = {
        "mirna": {"title": "miRNA", "searchType": "text","formatter":"GetMiRNA"},
        "precursor": {"title": "Precursor", "searchType": "text","formatter":""}
    };

    let miRNAColumns = getTableColumns(miRNAHead, "miRnaTable2");

    $("#miRnaTable2").bootstrapTable({
        columns:miRNAColumns
    })
}

function getTableColumns(headJson, table) {
    let columns = [];
    let checkbox = "";
    $.each(headJson, (field, json) => {
        let column  = {
            field: field,
            title: json.title,
            sortable: true,
            searchType: json.searchType
        }
        if(json.formatter !== ""){
            column["formatter"] = json.formatter
        }
        columns.push(column)
        checkbox += `<label class="my-table-checkbox">
                            <input type='checkbox' checked='checked' value="${field}" onclick="setColumns('${field}','${table}')"> ${json.title}
                            </label>`
    })
    $(`#${table}-check`).html(checkbox)
    return columns;
}

function GetSrrId(value,rows) {
    return `<a href="/mdmodb/browse/speciesInfo/${rows.id}" target="_blank">${value}</a>`
}

function GetGeneId(value,row) {
    return `<a href="/mdmodb/browse/mRNA/info/${row.id}" target="_blank">${value}</a>`
}

function GetMiRNA(value,row) {
    return `<a href="/mdmodb/browse/miRNA/info/${row.id}" target="_blank">${value}</a>`
}

